﻿<!--#include file="../inc/easp/easp.asp"-->
<!--#include file="../inc/conn1.asp"-->
<!--#include file="../inc/checklogin.asp"-->
<!--#include file="../inc/easyide.asp"-->
<% CheckLogin("../index.asp") %>
<%
	If Session("Authority")<>"0" Then
		Response.Write "<script type=""text/javascript"">top.location.href='../main.asp';</script>"
	end if				
%>
<%
  dim operate
  dim  gid
  dim groupname
  dim savepath
  dim timepath
  operate = Easp.Get("op")
  
  IF request.QueryString("action")="edit" Then      
        gid=request.QueryString("gid")        
        groupname=request.QueryString("groupname")        
        savepath=request.QueryString("savepath")        
        timepath=request.QueryString("timepath")
  End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  <%
		  Easp.w "Edit Group"
  %>
</title>
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<script type="text/javascript">
	var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
	document.writeln('<link rel="stylesheet" type="text/css" href="../css/' + StyleFile + '">');
	
	function checkform(obj)
{
	if (obj["txtGroupName"].value == "")
	{
		alert("Please Input Group Directory!");		
		obj["txtGroupName"].focus();
		return false;
	}
	
	if (obj["txtGroupPath"].value == "")
	{
		alert("Please Input Group Path!");		
		obj["txtGroupPath"].focus();
		return false;
	}
	
		if (obj["txtTimePath"].value == "")
	{
		alert("Please Input Group Path!");		
		obj["txtTimePath"].focus();
		return false;
	}	
	
	if(!IsDirectory(obj["txtGroupPath"].value))
	{
		alert("Group Directory Format Wrong!You must start with \"/\"");
		obj["txtGroupPath"].focus();
		return false;
	}	
	
	return true;
}

function IsDirectory(str)
{
	var regexp = /^\/[a-zA-Z0-9_\.]+/;
	if (!regexp.exec(str)) return false;
	return true;
}
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
</head>
<body>
<div id="container">
	<div id="header">
    <div id="divAccount" style="float:right;">
        <a href="../user/account.asp" style="color:white">Account</a>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="../inc/logout.asp" style="color:white">Logout</a>
    </div>
		<h2><% Easp.w "Edit Group" %></h2>
		<div id="topmenu">
			<ul>
				<li><a href="../main.asp">Home</a></li>
				<li class="current"><a href="#">Country</a></li>
				<li><a href="../holiday/index.asp">Holiday</a></li>
				<li><a href="../Times/index.asp">Times</a></li>
				<li><a href="../wallboard/index.asp">WallBoard</a></li>
				<%
				   If Session("Authority")="0" Then 
				       Response.Write("<li><a href='../user/index.asp'>User</a></li>")
				   End if
				%>
				<li><% If Session("Passed")=true Then %><a href="../inc/logout.asp">Logout</a><% End If %></li>
			</ul>
		</div>
	</div>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<!--<li><a href="<%=request.serverVariables("Http_REFERER")%>" class="goback">GoBack</a></li>-->
				<li><a href="Group.asp" class="goback">GoBack</a></li>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content" align="center">	
				<div id="loginbox" align="center" style="margin: 10px 45px; width: 496px;">					
					<form name="form1" id="form4" action="group.asp?action=edit" onSubmit="return checkform(this)" method="post">
					  <div id="divGroup"  name="divGroup">
					    <table>
					      <tr>
							  <% 
								    Easp.w "<td>Group Name:</td>"
									Easp.w "<td><input name='txtGroupName' type='text' value='" & groupname &"' id='txtGroupName' /></td>"				      
							  %>						    
						  </tr>
						   <tr>
							  <%
								    Easp.w "<td>Group Path:</td>"
									Easp.w "<td><input name='txtGroupPath' type='text' id='txtGroupPath' value='"&savepath&"'/></td>"				      
							  %>						    
						  </tr>		
						   <tr>
							  <%
								    Easp.w "<td>Group Path:</td>"
									Easp.w "<td><input name='txtTimePath' type='text' id='txtTimePath' value='"&timepath&"'/></td>"				      
							  %>						    
						  </tr>								  
						  <tr>
						      <%
						           Easp.w "<td><input name='gid' type='hidden' value='"&gid&"' id='gid' /></td>"
						           Easp.w "<td></td>"
							  %>
						  </tr>
						  <tr>
						      <%
                        Easp.w "<td><input class='btn' type='submit' value='Alter' /></td>"
						            Easp.w "<td><input name='reset' type='reset' class='btn' value='Reset' /></td>"
							  %>
						  </tr>
					    </table>					    
					  </div>
					</form>
				</div>
	</div>
	<!--#include file="../inc/footer.asp" -->
</div>
</body>
</html>
